<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title></title>
    <link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/css/custom.form.css">
    <script type="text/javascript" src="/js/main/jquery.js"></script>
    <script src="/layui/layui.all.js" charset="utf-8"></script>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/core.util.js"></script>
    <style>
        .layui-table-cell {
            min-height: 30px;
            height: initial;
        }
        .layui-table-cell, .layui-table-tool-panel li {
            white-space: initial;
            /*为了让字母和数字也换行*/
            word-break: break-word;
        }
    </style>
</head>
<body>
<div id="content" style="width: 100%;">
    <input type="hidden" th:value="${key}" id="key"/>
    <div class="row-fluid">
        <div class="widget-box">
            <div class="widget-title bg_lg">
            </div>
            <div class="widget-content">
                <div class="row-fluid">
                    <div class="span12">
                        <table class="layui-table" id="gzzxShowTable" lay-filter="gzzxShowTable"></table>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div  id="level2_jcgxjf_div" hidden>
        <table class="layui-hide" id="level2_jcgxjf_table" lay-filter="level2_jcgxjf_table" hidden></table>
    </div>

    <div  id="level2_zfxnjf_div" hidden>
        <table class="layui-hide" id="level2_zfxnjf_table" lay-filter="level2_zfxnjf_table" hidden></table>
    </div>

    <div  id="level2_cgyyjf_div" hidden>
        <table class="layui-hide" id="level2_cgyyjf_table" lay-filter="level2_cgyyjf_table" hidden></table>
    </div>

    <div  id="level2_qtxmjf_div" hidden>
        <table class="layui-hide" id="level2_qtxmjf_table" lay-filter="level2_qtxmjf_table" hidden></table>
    </div>

    <div  id="level2_ksfzrjf_div" hidden>
        <table class="layui-hide" id="level2_ksfzrjf_table" lay-filter="level2_ksfzrjf_table" hidden></table>
    </div>

    <div  id="level3_jccbjfmx_div" hidden>
        <table class="layui-hide" id="level3_jccbjfmx_table" lay-filter="level3_jccbjfmx_table" hidden></table>
    </div>
    <div  id="level3_jcrkjfmx_div" hidden>
        <table class="layui-hide" id="level3_jcrkjfmx_table" lay-filter="level3_jcrkjfmx_table" hidden></table>
    </div>
    <div  id="level3_ajccsxjfmx_div" hidden>
        <table class="layui-hide" id="level3_ajccsxjfmx_table" lay-filter="level3_ajccsxjfmx_table" hidden></table>
    </div>
    <div  id="level3_ajdxjfmx_div" hidden>
        <table class="layui-hide" id="level3_ajdxjfmx_table" lay-filter="level3_ajdxjfmx_table" hidden></table>
    </div>
    <div  id="level3_dchsajjfmx_div" hidden>
        <table class="layui-hide" id="level3_dchsajjfmx_table" lay-filter="level3_dchsajjfmx_table" hidden></table>
    </div>
    <div  id="level3_dbajjfmx_div" hidden>
        <table class="layui-hide" id="level3_dbajjfmx_table" lay-filter="level3_dbajjfmx_table" hidden></table>
    </div>
</div>
</body>
</html>
<script type="text/html" id="toolbar">
    <div class="layui-btn-container">
        <button class="layui-btn layui-btn-primary" lay-event="returnBack" >返回</button>
    </div>
</script>
<script th:inline="none">
    // 获取token
    let token = CoreUtil.getData("access_token");
    // 地址栏转义token中的#号
    let tokenQuery = token.replace("#", "%23");
    let gzzxShowTable;
    let table = layui.table;
    let form = layui.form;
    let layer = layui.layer;
    let $ = jQuery = layui.jquery;
    let laydate = layui.laydate;
    let upload = layui.upload;
    let element = layui.element;
    let levelFirst_table;
    $(function () {
        let key = $("#key").val();
        let colsTmp = [[
            {align: 'center', field: 'SWJGDM', title: '税务机关代码', hide:true},
            {align: 'center', field: 'SWJGMC', title: '机关名称', width:140},
            {align: 'center', field: 'JCZF', title: '稽查总分', width:140/* totalRowText: '合计：'*/},
            {align: 'center', field: 'KSPJJF', width:140, title: '平均积分',/* totalRow: '{{parseInt(d.TOTAL_NUMS)}}',*/ sort: true,},
            {align: 'center', field: 'QJPM', width:100, title: '排名'},
            {align: 'center', field: 'JBX', width:100, title: '稽比析'},
            {align: 'center', field: 'JCGXJF', title: '稽查贡献积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'JCGXJF'},
            {align: 'center', field: 'ZFXNJF', title: '执法效能积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'ZFXNJF'},
            {align: 'center', field: 'CGYYJF', title: '成果运用积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'CGYYJF'},
            {align: 'center', field: 'QTXMJF', title: '其他项目积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'QTXMJF'},
            {align: 'center', field: 'KSFZRJF', title: '负责人积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'KSFZRJF'}
            ]];
        if("jz" == key){
            colsTmp = [[
                {align: 'center', field: 'SWJGDM',title: '税务机关代码', hide:true},
                {align: 'center',field: 'SWJGMC',style: 'cursor:pointer;text-decoration:underline',event: 'JCJXZKS',title: '机关名称', width:140},
                {align: 'center',field: 'JCZF',title: '稽查总分',width:140},
                {align: 'center',field: 'KSPJJF',width:140,title: '平均积分'},
                {align: 'center', field: 'QJPM', width:100, title: '排名',},
                {align: 'center', field: 'JBX', width:100, title: '稽比析'},
                {align: 'center', field: 'JCGXJF', title: '稽查贡献积分', width:140},
                {align: 'center', field: 'ZFXNJF', title: '执法效能积分', width:140},
                {align: 'center', field: 'CGYYJF', title: '成果运用积分', width:140},
                {align: 'center', field: 'QTXMJF', title: '其他项目积分', width:140},
                {align: 'center', field: 'KSFZRJF', title: '负责人积分', width:140}
            ]];
        }
        gzzxShowTableLoad(colsTmp);
        function gzzxShowTableLoad(colsTmp) {
            levelFirst_table  =  table.render({
                elem: '#gzzxShowTable',
                id: 'gzzxShowTable',
                contentType: 'application/json',
                headers: {
                    "authorization": token
                },
                cols:colsTmp,
                toolbar: '#toolbar',
                page: false ,// 开启分页
                url: '/statistics/gzzx/firstLevel', //数据接口
                method: 'POST',
                parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": 10000, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null
                            : CoreUtil.paramsDecrypt(res.data.tableDatas)
                    }
                },
            });
        }
    });
    layui.config({
        base: '/'
    }).extend({
        tableMerge: 'layui-ext/tableMerge/tableMerge'
    }).use(['table', 'layer', 'laydate', 'upload', 'element','tableMerge'], function () {
        var tableMerge = layui.tableMerge;
        table.on('tool(gzzxShowTable)', function (obj) {
            let event = obj.event;
            let swjgDm = obj.data.SWJGDM;
            if (event === "JCGXJF") {
                renderXzTable(obj,2);
                openXzDiv('稽查贡献积分','level2_jcgxjf_div');
            } else if (event === "ZFXNJF") {
                renderXzTable(obj,2);
                openXzDiv('执法效能积分','level2_zfxnjf_div');
            } else if (event === "CGYYJF") {
                renderXzTable(obj,2);
                openXzDiv('成果运用积分','level2_cgyyjf_div');
            } else if (event === "QTXMJF") {
                renderXzTable(obj,2);
                openXzDiv('其他项目积分','level2_qtxmjf_div');
            } else if (event === "KSFZRJF") {
                renderXzTable(obj,2);
                openXzDiv('科室负责人积分','level2_ksfzrjf_div');
            }else if (event === "JCJXZKS"){//稽查局下钻到科室 还是理论上还是一级数据
                let colsTmp = [[
                    {align: 'center', field: 'SWJGDM', title: '税务机关代码', hide:true},
                    {align: 'center', field: 'SWJGMC', title: '机关名称', width:140},
                    {align: 'center', field: 'JCZF', title: '稽查总分', width:140},
                    {align: 'center', field: 'KSPJJF', width:140, title: '平均积分'},
                    {align: 'center', field: 'QJPM', width:100, title: '排名'},
                    {align: 'center', field: 'JBX', width:100, title: '稽比析'},
                    {align: 'center', field: 'JCGXJF', title: '稽查贡献积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'JCGXJF'},
                    {align: 'center', field: 'ZFXNJF', title: '执法效能积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'ZFXNJF'},
                    {align: 'center', field: 'CGYYJF', title: '成果运用积分', width: 140, style: 'cursor:pointer;text-decoration:underline', event: 'CGYYJF'},
                    {align: 'center', field: 'QTXMJF', title: '其他项目积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'QTXMJF'},
                    {align: 'center', field: 'KSFZRJF', title: '负责人积分', width:140, style: 'cursor:pointer;text-decoration:underline', event: 'KSFZRJF'}
                    ]];
                table.render({
                    elem: '#gzzxShowTable',
                    id: 'gzzxShowTable',
                    contentType: 'application/json',
                    headers: {
                        "authorization": token
                    },
                    cols:colsTmp,
                    toolbar: '#toolbar',
                    page: false ,// 开启分页
                    where:{swjgDm:swjgDm} ,
                    url: '/statistics/gzzx/firstLevel', //数据接口
                    method: 'POST',
                    parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                        return {
                            "code": res.code, //解析接口状态
                            "msg": res.msg, //解析提示文本
                            "count": 10000, //解析数据长度
                            "data": CoreUtil.isEmpty(res.data) ? null
                                : CoreUtil.paramsDecrypt(res.data.tableDatas)
                        }
                    },
                });
            }
        });

        function openXzDiv(title,divId){
            layer.open({
                type : 1,
                skin : 'layui-layer-molv',
                title : title,
                area : [ '100%', '100%' ],
                shade : 0.8,
                shadeClose : true,
                content : jQuery("#"+divId),
                btn : [ '取消' ],
            });
        }

        function renderXzTable(obj,level){
            let event = obj.event;
            let swjgDm = obj.data.SWJGDM;
            let colsTmp;
            let elemTmp;
            let idTmp ;
            let totalRowTmp = false;
            let pageTmp = false;
            let whereParam = {swjgDm:swjgDm,type:event};
            let myParesDataFunction=function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.msg, //解析提示文本
                    "count": 10000, //解析数据长度
                    "data": CoreUtil.isEmpty(res.data) ? null
                        : CoreUtil.paramsDecrypt(res.data.tableDatas)
                }
            };
            if (event === "JCGXJF") {
                colsTmp = [[
                    {align: 'center', field: 'SWJGMC',title: '机关名称'},
                    {align: 'center', field: 'SWJGDM',title: '机关代码',hide:true},
                    {align: 'center', field: 'CBDF',title: '稽查查补(退)贡献积分', style: 'cursor:pointer;text-decoration:underline', event: 'JCCBJF'},
                    {align: 'center', field: 'RKDF',title: '稽查入库贡献积分', style: 'cursor:pointer;text-decoration:underline', event: 'JCRKJF'},
                    // {align: 'center', field: 'ZCRKDF',title: '稽查自查入库贡献积分'}
                ]];
                elemTmp = 'level2_jcgxjf_table';
                idTmp= 'level2_jcgxjf_table';
            } else if (event === "ZFXNJF") {
                colsTmp =[[
                    {align: 'center', field: 'SWJGMC',title: '机关名称'},
                    {align: 'center', field: 'SWJGDM',title: '机关代码',hide:true},
                    {align: 'center', field: 'CCSXJF',title: '案件查处时限积分', style: 'cursor:pointer;text-decoration:underline', event: 'AJCCSXJF'},
                    {align: 'center', field: 'AJDXJF',title: '案件定性积分', style: 'cursor:pointer;text-decoration:underline', event: 'AJDXJF'}
                ]];
                elemTmp = 'level2_zfxnjf_table';
                idTmp= 'level2_zfxnjf_table';
            } else if (event === "CGYYJF") {
                colsTmp = [[
                    {align: 'center', field: 'SWJGMC',title: '机关名称'},
                    {align: 'center', field: 'SWJGDM',title: '机关代码',hide:true},
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'AJCCCGJYZFXCTJJF',title: '案件查处成果和经验做法获得省部级以上表彰或者省部级以上媒体宣传推介积分'},
                    {align: 'center', field: 'DXALDJYZFJF',title: '典型案例的经验做法积分'}
                ]];
                elemTmp = 'level2_cgyyjf_table';
                idTmp= 'level2_cgyyjf_table';
            } else if (event === "QTXMJF") {
                colsTmp = [[
                    {align: 'center', field: 'SWJGMC',title: '机关名称'},
                    {align: 'center', field: 'SWJGDM',title: '机关代码',hide:true},
                    {align: 'center', field: 'DCHSAJJF',title: '调查核实案件积分', style: 'cursor:pointer;text-decoration:underline', event: 'DCHSAJJF'},
                    {align: 'center', field: 'DBAJJF',title: '督办案件积分', style: 'cursor:pointer;text-decoration:underline', event: 'DBAJJF'},
                    {align: 'center', field: 'QTJF',title: '其他积分'}
                ]];
                elemTmp = 'level2_qtxmjf_table';
                idTmp= 'level2_qtxmjf_table';
            } else if (event === "KSFZRJF") {
                colsTmp = [[
                    {align: 'center', field: 'KSPJJF',merge: true,title: '科室平均积分'},
                    {align: 'center', field: 'SWJGMC',title: '机关名称'},
                    {align: 'center', field: 'SWJGDM',title: '机关代码',hide:true},
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'DJJFSRXXGCDDESDJS',title: '党建积分－深入学习贯彻党的二十大精神，认真落实中央部署要求，扎实开展主题教育'},
                    {align: 'center', field: 'DJJFCJJCZZDJPPXSGZ',title: '党建积分－参加基层组织党建品牌选树工作'},
                    {align: 'center', field: 'JJJF',title: '纪检积分'}
                ]];
                elemTmp = 'level2_ksfzrjf_table';
                idTmp= 'level2_ksfzrjf_table';
                // totalRowTmp = true;
                whereParam = {swjgDm:swjgDm,type:event,kspjjf:obj.data.KSPJJF};
            }
            //下面是三级 未完成
            else if (event === "JCCBJF") {
                colsTmp =[[
                    {align: 'center', field: 'JCRY',title: '检查人员'},
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'AJLY',title: '案件来源'},
                    {align: 'center', field: 'CBJE',title: '查补额'},
                    {align: 'center', field: 'RKJE',title: '入库额'},
                    {align: 'center', field: 'YJWJSK',title: '已查实并且超过追征期限的应缴未缴税款'},
                    {align: 'center', field: 'QYKSSJTZ',title: '已查实但因企业亏损仅涉及调账'},
                ]];
                elemTmp = 'level3_jccbjfmx_table';
                idTmp= 'level3_jccbjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }else if (event === "JCRKJF") {
                colsTmp =[[
                    {align: 'center', field: 'JCRY',title: '检查人员'},
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'AJLY',title: '案件来源'},
                    {align: 'center', field: 'CBJE',title: '查补额'},
                    {align: 'center', field: 'RKJE',title: '入库额'},
                    {align: 'center', field: 'YJWJSK',title: '已查实并且超过追征期限的应缴未缴税款'},
                    {align: 'center', field: 'QYKSSJTZ',title: '已查实但因企业亏损仅涉及调账'},
                ]];
                elemTmp = 'level3_jcrkjfmx_table';
                idTmp= 'level3_jcrkjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }else if (event === "AJCCSXJF") {
                colsTmp =[[
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'LARQ',title: '立案时间'},
                    {align: 'center', field: 'ZSSSSJ',title: '送审时间（助手）'},
                    {align: 'center', field: 'JCSC',title: '检查时长（助手）'},
                    {align: 'center', field: 'FHJCSJ',title: '返回补充稽查时间（助手）'},
                    {align: 'center', field: 'ECSSSJ',title: '二次送审时间（助手）'},
                    {align: 'center', field: 'SQTSRQ',title: '提审时间（三期）'},
                    {align: 'center', field: 'SCYQPZRQ',title: '首次延期批准时间（三期）'},
                    {align: 'center', field: 'LSPZRQ',title: '两书批准日期（三期）'},
                    {align: 'center', field: 'ZJAJPZRQ',title: '终结批准时间（三期）'},
                    {align: 'center', field: 'SLSC',title: '审理时长（助手）'},
                    {align: 'center', field: 'DF',title: '得分'},
                ]];
                elemTmp = 'level3_ajccsxjfmx_table';
                idTmp= 'level3_ajccsxjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }else if (event === "AJDXJF") {
                colsTmp =[[
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'AJLY',title: '案件来源'},
                    {align: 'center', field: 'SSJDSSJ',title: '送市局大审时间'},
                    {align: 'center', field: 'YBTSE',title: '查补税费合计'},
                    {align: 'center', field: 'AJDX',title: '案件定性'},
                    {align: 'center', field: 'JARQ',title: '结案时间'},
                    {align: 'center', field: 'DXDF',title: '得分'},
                ]];
                elemTmp = 'level3_ajdxjfmx_table';
                idTmp= 'level3_ajdxjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }else if (event === "DCHSAJJF") {
                colsTmp =[[
                    {align: 'center', field: 'DCHSAYBH',title: '调查核实案源编号'},
                    {align: 'center', field: 'DCHSQSRQ',title: '调查核实起始日期'},
                    {align: 'center', field: 'DCHSJSRQ',title: '调查核实结束日期'},
                    {align: 'center', field: 'JCKS',title: '检查科室'},
                    {align: 'center', field: 'JCRY',title: '检查人员'},
                    {align: 'center', field: 'SFLA',title: '是否立案'},
                    {align: 'center', field: 'DF',title: '得分'},
                ]];
                elemTmp = 'level3_dchsajjfmx_table';
                idTmp= 'level3_dchsajjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }else if (event === "DBAJJF") {
                colsTmp =[[
                    {align: 'center', field: 'JCAJBH',title: '案件编号'},
                    {align: 'center', field: 'AJMC',title: '案件名称'},
                    {align: 'center', field: 'AJLY',title: '案件来源'},
                    {align: 'center', field: 'LARQ',title: '立案日期'},
                    {align: 'center', field: 'JCKS',title: '检查科室'},
                    {align: 'center', field: 'JCRY',title: '检查人员'},
                    {align: 'center', field: 'ZJAJPZRQ',title: '终结案件批准日期'},
                    {align: 'center', field: 'JARQ',title: '结案日期'},
                    {align: 'center', field: 'DF',title: '得分'}
                ]];
                elemTmp = 'level3_dbajjfmx_table';
                idTmp= 'level3_dbajjfmx_table';
                pageTmp = true;
                myParesDataFunction = function (res){
                    return {
                        "code": res.code, //解析接口状态
                        "msg": res.msg, //解析提示文本
                        "count": CoreUtil.isEmpty(res.data) ? 0 : res.data.total, //解析数据长度
                        "data": CoreUtil.isEmpty(res.data) ? null : res.data.records //解析数据列表
                    }
                };
            }

            let url="";
            if(2 == level){
                url='/statistics/gzzx/secondLevel';
            }else if(3 == level){
                url='/statistics/gzzx/thirdLevel';
            }
            table.render({
                elem: '#'+elemTmp,
                id: idTmp,
                totalRow: totalRowTmp, // 显示总行数
                contentType: 'application/json',
                headers: {
                    "authorization": token
                },
                cols:colsTmp,
                page: pageTmp ,// 开启分页
                where:whereParam,
                url: url, //数据接口
                method: 'POST',
                parseData: myParesDataFunction, done: function(res, curr, count){
                tableMerge.render(this)
            }
            });
        }

        //点击二级数据下钻列表事件-稽查贡献积分
        table.on('tool(level2_jcgxjf_table)', function (obj) {
            let event = obj.event;
            renderXzTable(obj,3);
            if (event === "JCCBJF") {
                openXzDiv('稽查查补（退）贡献积分','level3_jccbjfmx_div');
            } else if (event === "JCRKJF") {
                openXzDiv('稽查入库贡献积分','level3_jcrkjfmx_div');
            }
        });
        //点击二级数据下钻列表事件-执法效能积分
        table.on('tool(level2_zfxnjf_table)', function (obj) {
            let event = obj.event;
            renderXzTable(obj,3);
            if (event === "AJCCSXJF") {
                openXzDiv('案件查处时限积分','level3_ajccsxjfmx_div');
            } else if (event === "AJDXJF") {
                openXzDiv('案件定性积分','level3_ajdxjfmx_div');
            }
        });
        //点击二级数据下钻列表事件-其他项目积分
        table.on('tool(level2_qtxmjf_table)', function (obj) {
            let event = obj.event;
            renderXzTable(obj,3);
            if (event === "DCHSAJJF") {
                openXzDiv('调查核实案件积分','level3_dchsajjfmx_div');
            } else if (event === "DBAJJF") {
                openXzDiv('督办案件积分','level3_dbajjfmx_div');
            }
        });
    });

    table.on('toolbar(gzzxShowTable)', function (obj) {
        levelFirst_table.reload({
            where: { //设定异步数据接口的额外参数，任意设
                swjgDm: "",
            }
        });
    });
    function skipOpen(gnurl, gnid, title) {
        if (CoreUtil.isEmpty(gnurl) || CoreUtil.isEmpty(gnid) || CoreUtil.isEmpty(title)) {

            return false;
        } else {
            var gnurlArr = gnurl.split(",");
            var gnidArr = gnid.split(",");
            var titleArr = title.split(",");
            for (var i in gnurlArr) {
                tianzhuan(gnurlArr[i], gnidArr[i], titleArr[i])
            }
        }
    }

    function tianzhuan(gnurl, gnid, title) {
        if ($(".layui-tab-title li[lay-id]").length <= 0) {

            var title = "<span>" + title + "</span>";
            active.tabAdd(gnurl, gnid, title);

        } else {
            var isData = false;
            $.each($(".layui-tab-title li[lay-id]"),
                function () {
                    if ($(this).attr("lay-id") == dataid.attr("data-id")) {
                        isData = true;
                    }
                })

            if (isData == false) {
                if (CoreUtil.isEmpty(dataid
                    .attr("data-icon"))) {
                    var title = "<span>"
                        + dataid.attr("data-title")
                        + "</span>";
                    active.tabAdd(dataid.attr("data-url"),
                        dataid.attr("data-id"), title);
                } else {
                    var title = "<span>"
                        + dataid.attr("data-title")
                        + "</span>";
                    title = '<i class="layui-icon '
                        + dataid.attr("data-icon")
                        + '"></i> ' + title;
                    active.tabAdd(dataid.attr("data-url"),
                        dataid.attr("data-id"), title);
                }
            }
        }

        active.tabChange(gnid);
    };

    //触发事件
    var active = {
        tabAdd: function (url, id, title) {
            if (url != "" && url != null && url != undefined) {
                window.parent.layui.element
                    .tabAdd(
                        'tab',
                        {
                            title: title,
                            content: '<iframe data-frameid="'
                                + id
                                + '" frameborder="0" name="content" width="100%" src="'
                                + url + '"></iframe>',
                            id: id
                        })
            }
            FrameWH();//计算框架高度
        },
        tabChange: function (id) {
            //切换到指定Tab项
            window.parent.layui.element.tabChange('tab', id); //切换到：用户管理
            $("iframe[data-frameid='" + id + "']").attr("src",
                $("iframe[data-frameid='" + id + "']").attr("src"))//切换后刷新框架
        },

    };

    function FrameWH() {
        var h = $(window).height();
        $(window.parent.document).find("iframe").css("height", h + "px");
    };

</script>